﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace SuiYuan.UI.Controls.Tabs
{
    public enum TabItemType
    {
        Default,
        Simple,
        Card
    }

    public class LayUITabItem : TabItem
    {
        /// <summary>
        /// 
        /// </summary>
        public TabItemType Type
        {
            get { return (TabItemType)GetValue(TypeProperty); }
            set { SetValue(TypeProperty, value); }
        }


        /// <summary>
        /// 带关闭按钮
        /// </summary>
        public bool CloseButton
        {
            get { return (bool)GetValue(CloseButtonProperty); }
            set { SetValue(CloseButtonProperty, value); }
        }

        public static readonly DependencyProperty TypeProperty = DependencyProperty.Register("Type", typeof(TabItemType), typeof(LayUITabItem), new PropertyMetadata(TabItemType.Default));
        public static readonly DependencyProperty CloseButtonProperty = DependencyProperty.Register("CloseButton", typeof(bool), typeof(LayUITabItem), new PropertyMetadata(false));

        /// <summary>
        /// 关闭item事件
        /// </summary>
        public event RoutedEventHandler CloseItem
        {
            add { AddHandler(CloseItemEvent, value); }
            remove { RemoveHandler(CloseItemEvent, value); }
        }
        public static readonly RoutedEvent CloseItemEvent = EventManager.RegisterRoutedEvent("CloseItem", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(LayUITabItem));

    }
}
